﻿Imports ReglasNegocio
Imports System.Collections.Generic
Imports System.Data
Partial Public Class Bandeja_Empleados_Excel_Prestamo
    Inherits System.Web.UI.Page
    Protected strFechaActual As String
    Protected strHoraActual As String
    Protected ParamDNI, ParamAPAT, ParamAMAT, ParamNOM, ParamINI, ParamFin As String
    Protected dsConsulta As New DataSet

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Put user code to initialize the page here
        Response.Expires = 0
        Response.ContentEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1")
        Response.ContentType = "application/xls"
        Response.AppendHeader("Content-disposition", "attachment; filename=Reporte_PrestamosEmpleados.xls")
        SRT_RecuperacionFechas()
        CargaGrillaPrestamos(PreviousPage.PrestamoDNIExcel, PreviousPage.PrestamoAPAExcel, PreviousPage.PrestamoAMAExcel, PreviousPage.PrestamoNOMExcel, PreviousPage.PrestamoFec1Excel, PreviousPage.PrestamoFec2Excel)
    End Sub
    Private Sub SRT_RecuperacionFechas()
        strFechaActual = Format(DateTime.Now.Date, "dd/MM/yyyy")
        Dim minuto As String
        If DateTime.Now.Minute < 10 Then
            minuto = "0" & DateTime.Now.Minute
        Else
            minuto = DateTime.Now.Minute
        End If
        strHoraActual = DateTime.Now.Hour & ":" & minuto
    End Sub


    Private Sub CargaGrillaPrestamos(ByVal pstrDNI As String, ByVal pstrAPAT As String, ByVal pstrAMAT As String, ByVal pstrNombre As String, ByVal pstrInicio As String, ByVal pstrFin As String)
        ParamDNI = (pstrDNI)
        ParamAPAT = UCase(pstrAPAT)
        ParamAMAT = UCase(pstrAMAT)
        ParamNOM = UCase(pstrNombre)
        ParamINI = UCase(pstrInicio)
        ParamFin = UCase(pstrFin)
        Dim Catalogo As CatalogoEmpleado = New CatalogoEmpleado()
        dsConsulta = Catalogo.ListaPrestamos(pstrDNI, pstrAPAT, pstrAMAT, pstrNombre, pstrInicio, pstrFin)
    End Sub

End Class